package org.seckill.dto;

/**
 * 爆漏秒杀地址DTO
 * Created by zzz on 2016/11/1.
 */
public class Exposer {
    /**
     * 是否暴露秒杀地址
     */
    private boolean exposed;

    /**
     * 一种加密措施
     */
    private String md5;

    private long seckillId;

    /**
     * 系统当前时间
     */
    private long now;

    /**
     * 系统当前开启时间
     */
    private long start;


    /**
     * 系统当前结束的时间
     */
    private long end;


    public Exposer(boolean exposed, String md5, long seckillId) {
        this.exposed = exposed;
        this.md5 = md5;
        this.seckillId = seckillId;
    }

    public Exposer(boolean exposed, long seckillId, long now, long start, long end) {
        this.exposed = exposed;
        this.seckillId = seckillId;
        this.now = now;
        this.start = start;
        this.end = end;
    }

    public Exposer(boolean exposed, long seckillId) {
        this.exposed = exposed;
        this.seckillId = seckillId;
    }

    /**
     * 是否开始秒杀
     * @return
     */
    public boolean isExposed(){
        return exposed;
    }

    public String getMd5() {
        return md5;
    }


    @Override
    public String toString() {
        return "Exposer{" +
                "exposed=" + exposed +
                ", md5='" + md5 + '\'' +
                ", seckillId=" + seckillId +
                ", now=" + now +
                ", start=" + start +
                ", end=" + end +
                '}';
    }
}
